Optimal. Leaf size=590 \[ -\frac{f (g+h x)^{-2 p} \left (a+b x+c x^2\right )^p \left (1-\frac{2 c (g+h x)}{2 c g-h \left (b-\sqrt{b^2-4 a c}\right )}\right )^{-p} \left (1-\frac{2 c (g+h x)}{2 c g-h \left (\sqrt{b^2-4 a c}+b\right )}\right )^{-p} F_1\left (-2 p;-p,-p;1-2 p;\frac{2 c (g+h x)}{2 c g-\left (b-\sqrt{b^2-4 a c}\right ) h},\frac{2 c (g+h x)}{2 c g-\left (b+\sqrt{b^2-4 a c}\right ) h}\right )}{2 h^3 p}-\frac{\left (-\sqrt{b^2-4 a c}+b+2 c x\right ) (g+h x)^{-2 p-1} \left (a+b x+c x^2\right )^p \left (\frac{\left (\sqrt{b^2-4 a c}+b+2 c x\right ) \left (2 c g-h \left (b-\sqrt{b^2-4 a c}\right )\right )}{\left (-\sqrt{b^2-4 a c}+b+2 c x\right ) \left (2 c g-h \left (\sqrt{b^2-4 a c}+b\right )\right )}\right )^{-p} \left (h \left (2 a h (2 f g-e h)-b \left (-d h^2-e g h+3 f g^2\right )\right )+2 c \left (f g^3-d g h^2\right )\right ) \, _2F_1\left (-2 p-1,-p;-2 p;-\frac{4 c \sqrt{b^2-4 a c} (g+h x)}{\left (2 c g-\left (b+\sqrt{b^2-4 a c}\right ) h\right ) \left (b+2 c x-\sqrt{b^2-4 a c}\right )}\right )}{2 h^2 (2 p+1) \left (2 c g-h \left (b-\sqrt{b^2-4 a c}\right )\right ) \left (a h^2-b g h+c g^2\right )}-\frac{(g+h x)^{-2 (p+1)} \left (a+b x+c x^2\right )^{p+1} \left (f g^2-h (e g-d h)\right )}{2 h (p+1) \left (a h^2-b g h+c g^2\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.755247, antiderivative size = 588, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 34, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.147, Rules used = {1655, 759, 133, 806, 726} \[ -\frac{f (g+h x)^{-2 p} \left (a+b x+c x^2\right )^p \left (1-\frac{2 c (g+h x)}{2 c g-h \left (b-\sqrt{b^2-4 a c}\right )}\right )^{-p} \left (1-\frac{2 c (g+h x)}{2 c g-h \left (\sqrt{b^2-4 a c}+b\right )}\right )^{-p} F_1\left (-2 p;-p,-p;1-2 p;\frac{2 c (g+h x)}{2 c g-\left (b-\sqrt{b^2-4 a c}\right ) h},\frac{2 c (g+h x)}{2 c g-\left (b+\sqrt{b^2-4 a c}\right ) h}\right )}{2 h^3 p}-\frac{\left (-\sqrt{b^2-4 a c}+b+2 c x\right ) (g+h x)^{-2 p-1} \left (a+b x+c x^2\right )^p \left (\frac{\left (\sqrt{b^2-4 a c}+b+2 c x\right ) \left (2 c g-h \left (b-\sqrt{b^2-4 a c}\right )\right )}{\left (-\sqrt{b^2-4 a c}+b+2 c x\right ) \left (2 c g-h \left (\sqrt{b^2-4 a c}+b\right )\right )}\right )^{-p} \left (2 c \left (f g^3-d g h^2\right )-h \left (-2 a h (2 f g-e h)-b h (d h+e g)+3 b f g^2\right )\right ) \, _2F_1\left (-2 p-1,-p;-2 p;-\frac{4 c \sqrt{b^2-4 a c} (g+h x)}{\left (2 c g-\left (b+\sqrt{b^2-4 a c}\right ) h\right ) \left (b+2 c x-\sqrt{b^2-4 a c}\right )}\right )}{2 h^2 (2 p+1) \left (2 c g-h \left (b-\sqrt{b^2-4 a c}\right )\right ) \left (a h^2-b g h+c g^2\right )}-\frac{(g+h x)^{-2 (p+1)} \left (a+b x+c x^2\right )^{p+1} \left (f g^2-h (e g-d h)\right )}{2 h (p+1) \left (a h^2-b g h+c g^2\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1655
Rule 759
Rule 133
Rule 806
Rule 726
Rubi steps
\begin{align*} \int (g+h x)^{-3-2 p} \left (a+b x+c x^2\right )^p \left (d+e x+f x^2\right ) \, dx &=\frac{\int (g+h x)^{-3-2 p} \left (-f g^2+d h^2-h (2 f g-e h) x\right ) \left (a+b x+c x^2\right )^p \, dx}{h^2}+\frac{f \int (g+h x)^{-1-2 p} \left (a+b x+c x^2\right )^p \, dx}{h^2}\\ &=-\frac{\left (f g^2-h (e g-d h)\right ) (g+h x)^{-2 (1+p)} \left (a+b x+c x^2\right )^{1+p}}{2 h \left (c g^2-b g h+a h^2\right ) (1+p)}-\frac{\left (2 c \left (f g^3-d g h^2\right )-h \left (3 b f g^2-b h (e g+d h)-2 a h (2 f g-e h)\right )\right ) \int (g+h x)^{-2-2 p} \left (a+b x+c x^2\right )^p \, dx}{2 h^2 \left (c g^2-b g h+a h^2\right )}+\frac{\left (f \left (a+b x+c x^2\right )^p \left (1-\frac{g+h x}{g-\frac{\left (b-\sqrt{b^2-4 a c}\right ) h}{2 c}}\right )^{-p} \left (1-\frac{g+h x}{g-\frac{\left (b+\sqrt{b^2-4 a c}\right ) h}{2 c}}\right )^{-p}\right ) \operatorname{Subst}\left (\int x^{-1-2 p} \left (1-\frac{2 c x}{2 c g-\left (b-\sqrt{b^2-4 a c}\right ) h}\right )^p \left (1-\frac{2 c x}{2 c g-\left (b+\sqrt{b^2-4 a c}\right ) h}\right )^p \, dx,x,g+h x\right )}{h^3}\\ &=-\frac{\left (f g^2-h (e g-d h)\right ) (g+h x)^{-2 (1+p)} \left (a+b x+c x^2\right )^{1+p}}{2 h \left (c g^2-b g h+a h^2\right ) (1+p)}-\frac{f (g+h x)^{-2 p} \left (a+b x+c x^2\right )^p \left (1-\frac{2 c (g+h x)}{2 c g-\left (b-\sqrt{b^2-4 a c}\right ) h}\right )^{-p} \left (1-\frac{2 c (g+h x)}{2 c g-\left (b+\sqrt{b^2-4 a c}\right ) h}\right )^{-p} F_1\left (-2 p;-p,-p;1-2 p;\frac{2 c (g+h x)}{2 c g-\left (b-\sqrt{b^2-4 a c}\right ) h},\frac{2 c (g+h x)}{2 c g-\left (b+\sqrt{b^2-4 a c}\right ) h}\right )}{2 h^3 p}-\frac{\left (2 c \left (f g^3-d g h^2\right )-h \left (3 b f g^2-b h (e g+d h)-2 a h (2 f g-e h)\right )\right ) \left (b-\sqrt{b^2-4 a c}+2 c x\right ) \left (\frac{\left (2 c g-\left (b-\sqrt{b^2-4 a c}\right ) h\right ) \left (b+\sqrt{b^2-4 a c}+2 c x\right )}{\left (2 c g-\left (b+\sqrt{b^2-4 a c}\right ) h\right ) \left (b-\sqrt{b^2-4 a c}+2 c x\right )}\right )^{-p} (g+h x)^{-1-2 p} \left (a+b x+c x^2\right )^p \, _2F_1\left (-1-2 p,-p;-2 p;-\frac{4 c \sqrt{b^2-4 a c} (g+h x)}{\left (2 c g-\left (b+\sqrt{b^2-4 a c}\right ) h\right ) \left (b-\sqrt{b^2-4 a c}+2 c x\right )}\right )}{2 h^2 \left (2 c g-\left (b-\sqrt{b^2-4 a c}\right ) h\right ) \left (c g^2-b g h+a h^2\right ) (1+2 p)}\\ \end{align*}
Mathematica [F] time = 3.63639, size = 0, normalized size = 0. \[ \int (g+h x)^{-3-2 p} \left (a+b x+c x^2\right )^p \left (d+e x+f x^2\right ) \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 1.356, size = 0, normalized size = 0. \begin{align*} \int \left ( hx+g \right ) ^{-3-2\,p} \left ( c{x}^{2}+bx+a \right ) ^{p} \left ( f{x}^{2}+ex+d \right ) \, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (f x^{2} + e x + d\right )}{\left (c x^{2} + b x + a\right )}^{p}{\left (h x + g\right )}^{-2 \, p - 3}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (f x^{2} + e x + d\right )}{\left (c x^{2} + b x + a\right )}^{p}{\left (h x + g\right )}^{-2 \, p - 3}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (f x^{2} + e x + d\right )}{\left (c x^{2} + b x + a\right )}^{p}{\left (h x + g\right )}^{-2 \, p - 3}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]